<template>
	<view>
		<view class="">
			<!-- 12212121 -->
			<view class="" v-html="register_rule" v-if='from==1'></view>
			<view class="" v-html="about_us" v-if='from==2'></view>
			<view class="" v-html="settlement" v-if='from==3'></view>
			<view class="" v-html="privacy_policy" v-if='from==4'></view>
			<view class="" v-html="franchisee_paper" v-if='from==5'></view>
		<!-- 		<u-parse :html="register_rule" v-if='from=="注册"'></u-parse>
				<u-parse :html="about_us" v-if='from=="关于"'></u-parse>
				<u-parse :html="settlement" v-if='from=="入驻"'></u-parse>
				<u-parse :html="privacy_policy" v-if='from=="隐私"'></u-parse>
				<u-parse :html="franchisee_paper" v-if='from=="加盟"'></u-parse> -->
		</view>
	</view>
</template>

<script>
	export default {
		name:'xieyi',
		onLoad(opt) {
			// console.log(opt)
			if(opt.from) {
				this.from=opt.from
				if(opt.from==1) {
					// document.getElementsByTagName('uni-page-head')[0].style.display = 'none'
					uni.setNavigationBarTitle({
						title:'注册协议'
					})
				}else if(opt.from==2) {
					// document.getElementsByTagName('uni-page-head')[0].style.display = 'none'
					uni.setNavigationBarTitle({
						title:'关于我们'
					})
				}else if(opt.from==3) {
					// document.getElementsByTagName('uni-page-head')[0].style.display = 'none'
					uni.setNavigationBarTitle({
						title:'入驻协议'
					})
				}else if(opt.from==4) {
					document.getElementsByTagName('uni-page-head')[0].style.display = 'none'
					uni.setNavigationBarTitle({
						title:'隐私政策'
					})
				}else if(opt.from==5) {
					// document.getElementsByTagName('uni-page-head')[0].style.display = 'none'
					uni.setNavigationBarTitle({
						title:'加盟文案'
					})
				}
			}
			this.getconfig()
		},
		data() {
			return {
				//来自哪
				from:'',
				//注册协议
				register_rule:'',
				//关于我们
				about_us:'',
				//入驻协议
				settlement:'',
				//隐私政策
				privacy_policy:'',
				//加盟文案
				franchisee_paper:''
			};
		},
		methods: {
			getconfig() {
				this.$api.config().then(res=>{
					// console.log(res)
					this.register_rule=res.data.register_rule
					this.about_us=res.data.about_us
					this.settlement=res.data.settlement
					this.privacy_policy=res.data.privacy_policy
					this.franchisee_paper=res.data.franchisee_paper
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
